﻿<UserControl x:Class="Teudu.InfoDisplay.LoadingPopup"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="240" d:DesignWidth="842">
    <UserControl.Resources>
        <Storyboard x:Key="ShowAnimation" x:Name="ShowAnimation">
            <DoubleAnimationUsingKeyFrames
                Storyboard.TargetName="PopUpTransform"
                Storyboard.TargetProperty="Y"
                Duration="0:0:01">
                <EasingDoubleKeyFrame KeyTime="0:0:01" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <!--<CircleEase EasingMode="EaseInOut"/>-->
                        <ElasticEase EasingMode="EaseInOut" Oscillations="2"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="MainShowAnimation" x:Name="MainShowAnimation">
            <DoubleAnimationUsingKeyFrames
                Storyboard.TargetName="MessageContainer"
                Storyboard.TargetProperty="Opacity"
                Duration="0:0:01" Completed="MainShowAnimation_Completed">
                <EasingDoubleKeyFrame KeyTime="0:0:01" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="MainHideAnimation" x:Name="MainHideAnimation">
            <DoubleAnimationUsingKeyFrames
                Storyboard.TargetName="MessageContainer"
                Storyboard.TargetProperty="Opacity"
                Duration="0:0:01" Completed="MainHideAnimation_Completed">
                <EasingDoubleKeyFrame KeyTime="0:0:01" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe WP"></Setter>
            <Setter Property="FontSize" Value="30"></Setter>
            <Setter Property="Foreground" Value="White"></Setter>
        </Style>
        <Style BasedOn="{StaticResource {x:Type TextBlock}}"
               TargetType="TextBlock"
               x:Key="MessageText">
            <Setter Property="Typography.Capitals" Value="Titling"></Setter>
            <Setter Property="FontFamily" Value="Segoe WP Bold"></Setter>
            <Setter Property="Margin" Value="0,-10,0,0"></Setter>
            <Setter Property="FontSize" Value="40"></Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="MessageContainer" Height="{Binding ActualHeight,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
        <Grid Background="Black" Opacity="0.7"/>
        <Grid Width="600" Height="150"  Background="#FF282457" VerticalAlignment="Center" HorizontalAlignment="Center">
            <StackPanel Margin="25">
                <TextBlock Text="Please wait..."/>
                <TextBlock Text="Checking for new events." Style="{StaticResource MessageText}"/>
            </StackPanel>
            <Grid.RenderTransform>
                <TransformGroup>
                    <TranslateTransform Y="{Binding ActualHeight,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" x:Name="PopUpTransform"/>
                </TransformGroup>
            </Grid.RenderTransform>
        </Grid>
            
    </Grid>
</UserControl>
